
import sys
from PyQt5.QtCore import *


class TheGuyTouch(QThread):
    sin = pyqtSignal(bool)
    def __init__(self):
        super().__init__()
        self._isPause = False

    def getGuy(self, Guy):
        self.IsTouch = False
        self.guy = Guy

    def getList(self, EnemySetlist):
        self.EnemySetList = EnemySetlist

    def run(self):
        self.IsTouch = False
        for EnemySet in self.EnemySetList:
            for Enemy in EnemySet.EnemyList:
                if Enemy.isVisible():
                    if self.guy.collidesWithItem(Enemy):
                        self.IsTouch = True
        self.sin.emit(self.IsTouch)

    def pause(self):
        self._isPause = True

    def resume(self):
        self._isPause = False

